/**
 * @file pin_dev_cfg.h
 * @author Blues Jiang
 * @brief 
 * @version 0.1
 * @date 2022-03-25
 * 
 * @copyright Copyright (c) 2022
 * 
 */

#ifndef _PIN_DEVICE_CONFIG_H_
#define _PIN_DEVICE_CONFIG_H_

#include <rtthread.h>
#include "n32g45x.h"
#include "drv_gpio.h"

/* UART Data */
#define MCU_UART_NAME                   "uart1"
#define PIN_MCU_TX                      68
#define PIN_MCU_RX                      69
// #define BT_UART_NAME                "uart3" //Need to remap
// #define PIN_BT_MTSR                 51
// #define PIN_BT_MRST                 52

#define PIN_COLUMN1                     39
#define PIN_COLUMN2                     40
#define PIN_COLUMN3                     41
#define PIN_COLUMN4                     42
#define PIN_COLUMN5                     43
#define PIN_COLUMN6                     44
#define PIN_ROW1                        1
#define PIN_ROW2                        2
#define PIN_ROW3                        3
#define PIN_ROW4                        4
#define PIN_ROW5                        5
#define PIN_ENCODER1A                   57
#define PIN_ENCODER1B                   58
#define PIN_ENCODER2A                   59
#define PIN_ENCODER2B                   60
#define PIN_ENCODER3A                   61
#define PIN_ENCODER3B                   62

// #define PIN_LED_POWER_CTRL
#define PIN_LED_DATA_SPI_MOSI           91
#define LED_DATA_SPI_BUS_NAME           "spi3"
#define LED_DATA_SPI_NAME               "spi30"
// #define PIN_LED_DATA_FEEDBACK

#define DISPLAY_SPI_BUS_NAME            "spi2"
#define DISPLAY_SPI_NAME                "spi20"
#define PIN_DISPLAY_SPI_MOSI            54
#define PIN_DISPLAY_SPI_SCK             52
#define PIN_DISPLAY_SPI_CS              51 
#define PIN_DISPLAY_DC                  55 //PD8
#define PIN_DISPLAY_RST                 56
// #define PIN_DISPLAY_BL_CTRL

// #define PIN_JOYSTICK_UP                  2
// #define PIN_JOYSTICK_DOWN                2
// #define PIN_JOYSTICK_LEFT                2
// #define PIN_JOYSTICK_RIGHT               2
// #define PIN_JOYSTICK_CENTER              2


void power_ctrl_pin_init(void);
void display_pin_init(void);
void switch_pin_init(void);
void gpio_pin_init(void);


#endif /* _PIN_DEVICE_CONFIG_H_ */
